package org.dtrd.modules.food.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.food.entity.bean.RecipeDetail;

import java.util.Date;


/**
 * <p>
 * 食谱
 * </p>
 *
 * @author QR
 * @since 2021-12-08
 */
@Getter
@Setter
@TableName("dtrd_ext_ems_yw_recipes")
public class DtrdExtEmsYwRecipes {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    /**
     * 食谱分类
     */
    @TableField("recipe_categoryId")
    private Integer recipeCategoryId;

    /**
     * 早餐
     */
    @TableField("recipe_breakfast")
    private Integer recipeBreakfast;

    /**
     * 午餐
     */
    @TableField("recipe_lunch")
    private Integer recipeLunch;

    /**
     * 晚餐
     */
    @TableField("recipe_dinner")
    private Integer recipeDinner;

    /**
     * 全天用烹调油（g）
     */
    @TableField("recipe_use_oil")
    private Float recipeUseOil;

    /**
     * 创建时间
     */
    @TableField("recipe_create_time")
    private Date recipeCreateTime;

    /**
     * 食谱标签
     */
    @TableField("recipe_tips")
    private String recipeTips;

    /**
     * 食谱列表
     */
    @TableField("recipe_list")
    private String recipeList;

    /**
     * 食谱名称
     */
    @TableField("recipe_name")
    private String recipeName;

    /**
     * 创建人
     */
    @TableField("recipe_creater")
    private String recipeCreater;

    /**
     * 最后编辑人
     */
    @TableField("recipe_editor")
    private String recipeEditor;

    /**
     * 最后编辑时间
     */
    @TableField("recipe_edit_time")
    private Date recipeEditTime;

    /**
     * 删除人
     */
    @TableField("recipe_deleter")
    private String recipeDeleter;

    /**
     * 删除时间
     */
    @TableField("recipe_del_time")
    private Date recipeDelTime;

    /**
     * 食谱URL
     */
    @TableField("recipe_url")
    private String recipeUrl;

    @TableField("recipe_meal")
    private String recipeMeal;

    @TableField("recipe_thumb")
    private String recipeThumb;

    /**
     * 早餐加餐
     */
    @TableField("recipe_breakfast_add")
    private Integer recipeBreakfastAdd;

    /**
     * 午餐加餐
     */
    @TableField("recipe_lunch_add")
    private Integer recipeLunchAdd;

    /**
     * 晚餐加餐
     */
    @TableField("recipe_dinner_add")
    private Integer recipeDinnerAdd;

    /**
     * 食谱千卡
     */
    @TableField("recipe_kcal")
    private Integer recipeKcal;

    public DtrdExtEmsYwRecipes init() {
        isDel = 0;
        recipeCreateTime = new Date();
        return this;
    }

    public DtrdExtEmsYwRecipes parseFromDto(RecipeDetail dto) {
        dataId = dto.getDataId();
        recipeCategoryId = dto.getRecipeCategoryid();
        recipeBreakfast = dto.getRecipeBreakfast();
        recipeLunch = dto.getRecipeLunch();
        recipeDinner = dto.getRecipeDinner();
        recipeUseOil = dto.getRecipeUseOil();
        recipeTips = dto.getRecipeTips();
        recipeList = dto.getRecipeList();
        recipeName = dto.getRecipeName();
        recipeUrl = dto.getRecipeUrl();
        recipeMeal = dto.getRecipeMeal();
        recipeThumb = dto.getRecipeThumb();
        recipeBreakfastAdd = dto.getRecipeBreakfastAdd();
        recipeLunchAdd = dto.getRecipeLunchAdd();
        recipeDinnerAdd = dto.getRecipeDinnerAdd();
        recipeKcal = dto.getRecipeKcal();
        return this;
    }


}
